#ifndef boot_h
#define boot_h

/*typedef struct{
    uint8_t boot_v;
    uint32_t boot_len;
    uint32_t boot_crc32;
}boot_info;

extern boot_info load_boot_info;
extern boot_info *p_boot_info;

uint32_t bootloader_load(void * vStart);
void region_load(void *vBufStart); 
void read_bootInfo(void *vAddress, boot_info *pBootInfo);
void write_bootInfo(void *vAddress, boot_info *pBootInfo);
unsigned int bootCode_isValid(void *vAddress,
                                        unsigned int boot_crc32,
                                        unsigned int boot_len);*/

void boot_load_proc(void);
void erase_valid(void);
uint8_t get_code_idx(void);
bool write_new_code(uint8_t idx, uint8_t zone_num, uint8_t *cod_buff);
bool finish_write_code(uint8_t code_len, uint8_t zone_num);
uint32_t get_code_crc(uint8_t code_len, uint8_t zone_num);
//void get_code(uint8_t code_idx, uint8_t zone_num, uint8_t *pbuff);

#endif
